<?php
// Widget parameters
if(!empty($formParams->elements)){
    $formParams->beginForm();
    $group = '';
    foreach($formParams->elements as $name => $elm) {
        if ($group != $elm->param->setting_group) {
            $group = $elm->param->setting_group;
            echo "<div class=\"form-group-heading\">{$group}</div>";
        }
        echo $elm->render();
    }
    echo CHtml::hiddenField('ParamType','widget');
    $formParams->endForm();
}
?>

<?php
// Layout parameters
if($layoutParamForm !== null && !empty($layoutParamForm->elements)){
    $layoutParamForm->beginForm();
    $group = '';
    foreach($layoutParamForm->elements as $name => $elm) {
        if ($group != $elm->param->setting_group) {
            $group = $elm->param->setting_group;
            echo "<div class=\"form-group-heading\">{$group}</div>";
        }
        echo $elm->render();
    }
    
    echo CHtml::hiddenField('ParamType','layout');    
    $layoutParamForm->endForm();
}
?>